package com.a.ims.service.impl;

import com.a.ims.entity.Cardmate;
import com.a.ims.entity.User;
import com.a.ims.mapper.UserMapper;
import com.a.ims.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {


    private final UserMapper userMapper;
    @Autowired
    public UserServiceImpl(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    //获取用户信息
    public User selectByAdminId(String id) {
        return userMapper.selectByAdminId(id);
    }

    //增加用户
    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }

    //修改用户信息
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    //删除用户
    public int deleteUser(User user) {
        return userMapper.deleteUser(user);
    }

    //获取所有用户
    public List<User> getAllUsers(User user){
        return userMapper.getAllUsers(user);
    }

}